package com.kt.uokos.yimo.wx.controller;

import com.kt.uokos.yimo.anno.validator.Order;
import com.kt.uokos.yimo.anno.validator.Sort;
import com.kt.uokos.yimo.dao.Brand;
import com.kt.uokos.yimo.service.BrandService;
import com.kt.uokos.yimo.util.ResponseUtil;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @description: TODO
 * @className: WxBrandController.java
 * @author: Kang Hao
 * @date: 2022/4/24 14:08
 **/

@RestController
@RequestMapping("/wx/brand/")
@Validated

public class WxBrandController {

    @Resource
    private BrandService brandService;

    @GetMapping("detail")
    public Object detail(@NotNull Integer id){
        Brand brand = brandService.findById(id);
        if (brand == null){
            return ResponseUtil.errs();
        }
        return ResponseUtil.ok(brand);
    }

}
